#include "WProgram.h"
void receiveEvent(int howMany);
void requestEvent();
#include "Wire.h"
 uint8_t outbuf[] = {0xf2, 0x79, 0x2e, 0x7d,
		    0x4d, 0x43, 0x01, 0xfd}; // sample data set


byte outbuf2[] = { 10, 22, 33, 44, 55, 66}; // sample data set

int ledPin = 13;

void receiveEvent(int howMany) {
  digitalWrite(ledPin, HIGH);   // sets the LED on

    while(Wire.available()) { 
    char c = Wire.receive(); // receive byte as a character
   
  }
} 
void requestEvent() {
  digitalWrite(ledPin, HIGH);   // sets the LED on
//Wire.send("hello ");
    Wire.send(outbuf2, 6);  // send data packet
}

void setup() {
    pinMode(ledPin, OUTPUT);      // sets the digital pin as output

    Wire.begin(0x52);			  // join i2c bus with address 0x52
  Wire.onReceive(receiveEvent); // register event
  Wire.onRequest(requestEvent); // register event
}
 
void loop() {
  delay(100);
} 

 

